package com.zhanglu.fun.services.authentication.role;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;

/**
 * @description
 * @Auther zhanglu
 * @Date 2017/9/21 下午2:19
 */
@RestController
public class RoleRouter {
    @Autowired
    private RoleService roleService;

    @ApiOperation(value = "根据用户id查询权限", notes = "根据用户id查询权限")
    @ApiResponses({@ApiResponse(code = 200, message = "请求成功", response = String.class, responseContainer = "List")})
    @GetMapping("/application/roles/{token}")
    List<String> getApplicationRolesByToken(@PathVariable("token") String token) {
        return roleService.getApplicationRolesByToken(token);
    }
}
